home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / miscuni.com / IOERROR.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-05-25  |  2.6 KB  |  62 lines

  1. (**********************************************************************)
  2. (*                        Unit IOError                                *)
  3. (*                                                                    *)
  4. (*                                                                    *)
  5. (*  Author:  Geoffrey W. Moehrke                                      *)
  6. (*  Date:  September 24, 1988                                         *)
  7. (*                                                                    *)
  8. (*  Purpose:  Exports a function to return a string based on the      *)
  9. (*            error number passed as a parameter.                     *)
  10. (*                                                                    *)
  11. (*  Source: F:\TP\UNIT\IOERROR.PAS                                    *)
  12. (**********************************************************************)
  13. Unit IOError;
  14.  
  15.   Interface
  16.  
  17.     Type
  18.       IOErrStr = String[35];
  19.  
  20.     function IOErrorMsg(Number: Integer):IOErrStr;
  21.  
  22.  
  23.   Implementation
  24.  
  25.   function IOErrorMsg(Number: Integer):IOErrStr;
  26.  
  27.   begin
  28.     case Number of
  29.         2 : IOErrorMsg := 'Invalid file name or file not found';
  30.         3 : IOErrorMsg := 'Path not found';
  31.         4 : IOErrorMsg := 'Too many open files';
  32.         5 : IOErrorMsg := 'File access denied';
  33.         6 : IOErrorMsg := 'Invalid file handle';
  34.        12 : IOErrorMsg := 'Invalid file access code';
  35.        15 : IOErrorMsg := 'Invalid drive number';
  36.        16 : IOErrorMsg := 'Cannot remove current directory';
  37.        17 : IOErrorMsg := 'Cannot rename across drives';
  38.       100 : IOErrorMsg := 'Disk read error';
  39.       101 : IOErrorMsg := 'Disk write error';
  40.       102 : IOErrorMsg := 'File not assigned';
  41.       103 : IOErrorMsg := 'File not open';
  42.       104 : IOErrorMsg := 'File not open for input';
  43.       105 : IOErrorMsg := 'File not open for output';
  44.       106 : IOErrorMsg := 'Invalid numeric format';
  45.       150 : IOErrorMsg := 'Disk is write-protected';
  46.       151 : IOErrorMsg := 'Unknown unit';
  47.       152 : IOErrorMsg := 'Drive not ready';
  48.       153 : IOErrorMsg := 'Unknown command';
  49.       154 : IOErrorMsg := 'CRC error in data';
  50.       155 : IOErrorMsg := 'Bad drive request structure length';
  51.       156 : IOErrorMsg := 'Disk seek error';
  52.       157 : IOErrorMsg := 'Unknown media type';
  53.       158 : IOErrorMsg := 'Sector not found';
  54.       159 : IOErrorMsg := 'Printer out of paper';
  55.       160 : IOErrorMsg := 'Device write fault';
  56.       161 : IOErrorMsg := 'Device read fault';
  57.       162 : IOErrorMsg := 'Hardware failure';
  58.    end;
  59.  end;
  60.  
  61.  
  62. end. { Unit IOError }